<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class AddFieldListorderToRbacMenuTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('rbac_menu', function (Blueprint $table) {
            $table->string('route')->nullable()->comment('路由地址')->after('route_name');
            $table->unsignedInteger('listorder',false)->default(0)->comment('排序')->after('icon');
            $table->boolean('is_visable')->default(false)->comment('是否隐藏')->after('listorder');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('rbac_menu', function (Blueprint $table) {
            $table->dropColumn('listorder');
        });
    }
}
